package com.lkd.mapper;

import com.lkd.dto.SkuClassDto;
import com.lkd.entity.SkuClass;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface SkuClassMapper {

    //分页查询
    List<SkuClass> findList(SkuClassDto skuClassDto);

    //保存
    @Insert("insert into tb_sku_class values (null,#{className},#{parentId})")
    Boolean save(SkuClass skuClass);

    //主键查询
    @Select("select * from tb_sku_class where class_id = #{classId}")
    SkuClass findById(Long classId);

    //修改
    @Update("update tb_sku_class set class_name = #{className},parent_id = #{parentId} where class_id = #{classId}")
    Boolean update(SkuClass skuClass);

    //主键删除
    @Delete("delete from tb_sku_class where class_id = #{classId}")
    Boolean deleteById(Long classId);
}
